import request from 'axios'

export function getMap(query) {
    let url;
    query.isQuxian ? url = `http://datavmap-public.oss-cn-hangzhou.aliyuncs.com/areas/bound/${query.code}.json` : url = `http://datavmap-public.oss-cn-hangzhou.aliyuncs.com/areas/children/${query.code}.json`;
    return request({
        url,
        method: 'get',
        params: query
    })
}

export function getTopNavData(query) {
    return request({
        url: '/api/manageWat/supervision/getJianDuSum',
        method: 'get',
        params: query
    })
}

export function getFuGaiLv(id, y, code) {
    return request({
        url: '/api/manageWat/statistics/areaSupervisionCoverageAll?code=' + id + '&year=' + y + "&areaCode=" + code,
        method: 'get',
        // params: query
    })
}

export function getSuiJi(query) {
    return request({
        url: '/api/manageWat/supervision/getJiansuijiSum',
        method: 'get',
        params: query
    })
}

export function getSuiJi2(query) {
    return request({
        url: '/api/manageWat/supervision/getJianDusuijiAchieve',
        method: 'get',
        params: query
    })
}

export function getRenJun(query) {
    return request({
        url: '/api/manageWat/statistics/householdCpaita',
        method: 'get',
        params: query
    })
}

// 左下 各区县覆盖率
export function getGeQuXianFuGaiLv(id, y, code) {
    return request({
        url: '/api/manageWat/statistics/areaSupervisionCoverage?code=' + id + '&year=' + y + "&areaCode=" + code,
        method: 'get',
        // params: query
    })
}

